<template>
  <div id="page2">
    <h1>收货信息</h1>
    <div>
      编号: <span v-text="product.productId"></span>
    </div>
    <div>
      商品名: <span v-text="product.productName"></span>
    </div>
    <div>
      标题: <span v-text="product.productTitle"></span>
    </div>
    <div>
      价格: <span v-text="product.productPrice"></span>
    </div>
  </div>
</template>

<script>
  import {getProduct} from "../../../api/modules/product";

  export default {
    name: "page",
    data(){
      return {
        id:this.$route.query.id,
        product:{
          productId:'',
          productName:'',
          productTitle:'',
          productPrice:''
        }
      }

    },
    mounted() {
      this.loadProduct()
    },
    methods:{
      loadProduct(){
        this.$API.product.getProduct(this.id).then(resp=>{
          console.log(resp)
          this.product = resp.data;
          console.log(this.product)
        });
      }
    }
  }
</script>

<style scoped>

</style>
